import service from "@/api/axios";


// 获取柜子信息列表
export const getCabinetListApi = (data) => {
    return service({
        url: "/cabinetManage",
        method: "GET",
        params: data
    })
}
// 获取区域的所有正常柜子信息列表
export const getAllCabinetListApi = (data) => {
    return service({
        url: "/cabinetManage/getCabinetList",
        method: "GET",
        params: data
    })
}
// 获取柜子的所有柜格
export const getCabinetLatListApi = (id) => {
    return service({
        url: `/cabinetManage/getLatByCabinet/${id}`,
        method: "GET",
    })
}
// 修改柜子
export const updateCabinetApi = (data) => {
    return service({
        url: "/cabinetManage",
        method: "POST",
        data
    })
}
// 添加柜子
export const addCabinetApi = (data) => {
    return service({
        url: "/cabinetManage",
        method: "PUT",
        data
    })
}
// 添加柜子的柜格
export const addCabinetLatApi = (data) => {
    return service({
        url: "/cabinetManage/addCabinetLat",
        method: "PUT",
        data
    })
}
// 删除柜子的柜格
export const deleteCabinetLatApi = (id) => {
    return service({
        url: `/cabinetManage/delLat/${id}`,
        method: "DELETE",
    })
}
// 修改柜子的柜格
export const updateCabinetLattApi = (data) => {
    return service({
        url: '/cabinetManage/updateCabinetLat',
        method: "POST",
        data
    })
}
// 启用柜子
export const startCabinetApi = (id) => {
    return service({
        url: `/cabinetManage/startCabinet/${id}`,
        method: "PUT",
    })
}
// 停用柜子
export const endCabinetApi = (id) => {
    return service({
        url: `/cabinetManage/${id}`,
        method: "DELETE",
    })
}




